\(\int \sqrt {a-a \sin ^2(e+f x)} \tan (e+f x) \, dx\) [459]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 24, antiderivative size = 19 \[ \int \sqrt {a-a \sin ^2(e+f x)} \tan (e+f x) \, dx=-\frac {\sqrt {a \cos ^2(e+f x)}}{f} \]

[Out]

-(a*cos(f*x+e)^2)^(1/2)/f

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3255, 3284, 16, 32} \[ \int \sqrt {a-a \sin ^2(e+f x)} \tan (e+f x) \, dx=-\frac {\sqrt {a \cos ^2(e+f x)}}{f} \]

[In]

Int[Sqrt[a - a*Sin[e + f*x]^2]*Tan[e + f*x],x]

[Out]

-(Sqrt[a*Cos[e + f*x]^2]/f)

Rule 16

Int[(u_.)*(v_)^(m_.)*((b_)*(v_))^(n_), x_Symbol] :> Dist[1/b^m, Int[u*(b*v)^(m + n), x], x] /; FreeQ[{b, n}, x
] && IntegerQ[m]

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rule 3255

Int[(u_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*cos[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a + b, 0]

Rule 3284

Int[((b_.)*sin[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> With[{ff = FreeFact
ors[Sin[e + f*x]^2, x]}, Dist[ff^((m + 1)/2)/(2*f), Subst[Int[x^((m - 1)/2)*((b*ff^(n/2)*x^(n/2))^p/(1 - ff*x)
^((m + 1)/2)), x], x, Sin[e + f*x]^2/ff], x]] /; FreeQ[{b, e, f, p}, x] && IntegerQ[(m - 1)/2] && IntegerQ[n/2
]

Rubi steps \begin{align*} \text {integral}& = \int \sqrt {a \cos ^2(e+f x)} \tan (e+f x) \, dx \\ & = -\frac {\text {Subst}\left (\int \frac {\sqrt {a x}}{x} \, dx,x,\cos ^2(e+f x)\right )}{2 f} \\ & = -\frac {a \text {Subst}\left (\int \frac {1}{\sqrt {a x}} \, dx,x,\cos ^2(e+f x)\right )}{2 f} \\ & = -\frac {\sqrt {a \cos ^2(e+f x)}}{f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00 \[ \int \sqrt {a-a \sin ^2(e+f x)} \tan (e+f x) \, dx=-\frac {\sqrt {a \cos ^2(e+f x)}}{f} \]

[In]

Integrate[Sqrt[a - a*Sin[e + f*x]^2]*Tan[e + f*x],x]

[Out]

-(Sqrt[a*Cos[e + f*x]^2]/f)

Maple [A] (verified)

Time = 0.41 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.11

method result size
derivativedivides \(-\frac {\sqrt {a -a \left (\sin ^{2}\left (f x +e \right )\right )}}{f}\) \(21\)
default \(-\frac {\sqrt {a -a \left (\sin ^{2}\left (f x +e \right )\right )}}{f}\) \(21\)
risch \(-\frac {\sqrt {\left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2} a \,{\mathrm e}^{-2 i \left (f x +e \right )}}\, {\mathrm e}^{2 i \left (f x +e \right )}}{2 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}-\frac {\sqrt {\left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2} a \,{\mathrm e}^{-2 i \left (f x +e \right )}}}{2 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}\) \(99\)

[In]

int((a-a*sin(f*x+e)^2)^(1/2)*tan(f*x+e),x,method=_RETURNVERBOSE)

[Out]

-1/f*(a-a*sin(f*x+e)^2)^(1/2)

Fricas [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.89 \[ \int \sqrt {a-a \sin ^2(e+f x)} \tan (e+f x) \, dx=-\frac {\sqrt {a \cos \left (f x + e\right )^{2}}}{f} \]

[In]

integrate((a-a*sin(f*x+e)^2)^(1/2)*tan(f*x+e),x, algorithm="fricas")

[Out]

-sqrt(a*cos(f*x + e)^2)/f

Sympy [F]

\[ \int \sqrt {a-a \sin ^2(e+f x)} \tan (e+f x) \, dx=\int \sqrt {- a \left (\sin {\left (e + f x \right )} - 1\right ) \left (\sin {\left (e + f x \right )} + 1\right )} \tan {\left (e + f x \right )}\, dx \]

[In]

integrate((a-a*sin(f*x+e)**2)**(1/2)*tan(f*x+e),x)

[Out]

Integral(sqrt(-a*(sin(e + f*x) - 1)*(sin(e + f*x) + 1))*tan(e + f*x), x)

Maxima [A] (verification not implemented)

none

Time = 0.38 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.05 \[ \int \sqrt {a-a \sin ^2(e+f x)} \tan (e+f x) \, dx=-\frac {\sqrt {-a \sin \left (f x + e\right )^{2} + a}}{f} \]

[In]

integrate((a-a*sin(f*x+e)^2)^(1/2)*tan(f*x+e),x, algorithm="maxima")

[Out]

-sqrt(-a*sin(f*x + e)^2 + a)/f

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 37 vs. \(2 (17) = 34\).

Time = 0.37 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.95 \[ \int \sqrt {a-a \sin ^2(e+f x)} \tan (e+f x) \, dx=\frac {2 \, \sqrt {a} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 1\right )}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 1\right )} f} \]

[In]

integrate((a-a*sin(f*x+e)^2)^(1/2)*tan(f*x+e),x, algorithm="giac")

[Out]

2*sqrt(a)*sgn(tan(1/2*f*x + 1/2*e)^4 - 1)/((tan(1/2*f*x + 1/2*e)^2 + 1)*f)

Mupad [B] (verification not implemented)

Time = 14.50 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.05 \[ \int \sqrt {a-a \sin ^2(e+f x)} \tan (e+f x) \, dx=-\frac {\sqrt {a-a\,{\sin \left (e+f\,x\right )}^2}}{f} \]

[In]

int(tan(e + f*x)*(a - a*sin(e + f*x)^2)^(1/2),x)

[Out]

-(a - a*sin(e + f*x)^2)^(1/2)/f